package cn.lyjuan.aliyun.mq.conf.java.callback;

import com.aliyun.openservices.ons.api.OnExceptionContext;
import com.aliyun.openservices.ons.api.SendCallback;
import com.aliyun.openservices.ons.api.SendResult;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

/**
 * 忽略回调信息
 * Created by chad on 2016/11/4.
 */
public class IgnoreSendCallback implements SendCallback
{
    private static Logger log = LogManager.getLogger(IgnoreSendCallback.class.getName());

    @Override
    public void onSuccess(SendResult sendResult)
    {
        log.debug("send mq msg succ: topic>>{} msgId>>{}", sendResult.getTopic(), sendResult.getMessageId());
    }

    @Override
    public void onException(OnExceptionContext onExceptionContext)
    {
        log.error("send mq msg err: topic>>{} msgId>>{}",onExceptionContext.getTopic(),
                onExceptionContext.getMessageId(), onExceptionContext.getException());
    }
}
